package com.framework.loippi.controller.api;

import com.framework.loippi.api.utils.ApiUtils;
import com.framework.loippi.entity.TCarousel;
import com.framework.loippi.service.TCarouselService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @ClassName CarouselController
 * @Description TODO
 * @Author fsociety
 * @Date 31/12/2019 上午11:08
 * @Version 1.0
 */

@Controller("apiCarouselController")
@RequestMapping("/api/carousel")
@Api(tags = {"轮播管理"})
public class CarouselController extends ApiBaseController {

   @Autowired
    TCarouselService carouselService;

    @RequestMapping(value = "/findAll.json", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
    @ApiOperation(value = "查询轮播图", notes = "{}")
    public @ResponseBody
    String findAll() {
        List<TCarousel> carousels = carouselService.findAll();
        return ApiUtils.success(carousels);
    }
}
